function link(obj, linknull) {
    if(!obj || !obj.link){
        console.log(linknull||'链接维护中...');
        return;
    }
    if (obj.type == 'web') {
        console.log('web:',obj.link);
        return;
        location.href = obj.link;
    } else if (obj.type == 'diy') {
        location.hash = '#diy?id=' + obj.link;
    } else if (obj.type == 'product') {
        location.hash = '#product?id=' + obj.link;
    } else if (obj.type == 'productClass') {
        location.hash = '#product-class?id=' + obj.link;
    } else if (obj.type == 'article') {
        location.hash = '#article?id=' + obj.link;
    } else if (obj.type == 'mini') {
        console.log('mini:',obj.link);
    } else{
        console.log(linknull||'链接维护中...');
    }
}

export default link;